package com.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.pojo.pms.Pms_Sku_Info;
import com.shop.pojo.pms.Pms_Spu_Info;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
//sku表
public interface Pms_SkuInfo_Mapper extends BaseMapper<Pms_Sku_Info> {

    @Select("select * from pms_sku_info where brand_id=${BrandId} and sku_id!=${skuId} order by rand() limit 0,5")
    List<Pms_Sku_Info> findAllSkuinfoByBrandId(@Param("BrandId") Long BrandId, @Param("skuId")Long skuId);//根据品牌来查询当前品牌下的商品
    @Select("select * from pms_sku_info where catalog_id=${catalogId} and sku_id!=${skuId} order by rand() limit 0,12")
    List<Pms_Sku_Info> findAllSkuinfoByCatalog(@Param("catalogId")Long catalogId,@Param("skuId")Long skuId);//根据分类来查询当前分类下的商品
@Select("select * from pms_sku_info order by rand() limit 0,8")
    List<Pms_Sku_Info> getQueryByThree();//随机抽取8条数据来进行查询
}
